import request from '@/utils/request'
// =============人员管理
// 获取成员
export function memberListApi(params) {
  return request({
    url: '/owners/member',
    method: 'get',
    params
  })
}

// 新增
export function addMemberApi(data) {
  return request({
    url: '/owners/member',
    method: 'post',
    data
  })
}

// 修改
export function editMemberApi(data) {
  return request({
    url: '/owners/member/' + data.id,
    method: 'put',
    data
  })
}

// 回显获取详细信息
export function getMemberApi(id) {
  return request({
    url: '/owners/member/' + id,
    method: 'get',
  })
}

// 删除成员
export function delmemberListApi(id) {
  return request({
    url: '/owners/member/' + id,
    method: 'delete',

  })
}

// ===============车辆管理
// 获取车辆信息
export function vehicleListApi(params) {
  return request({
    url: 'owners/vehicle',
    method: 'get',
    params
  })
}

// 新增
export function addVehicleApi(data) {
  return request({
    url: 'owners/vehicle',
    method: 'post',
    data
  })
}

// 修改
export function editVehicleApi(data) {
  return request({
    url: 'owners/vehicle/' + data.id,
    method: 'put',
    data
  })
}

// 回显获取详细信息
export function getVehicleApi(id) {
  return request({
    url: '/owners/vehicle/' + id,
    method: 'get',
  })
}

// 删除成员
export function delVehicleListApi(id) {
  return request({
    url: '/owners/vehicle/' + id,
    method: 'delete',

  })
}

// ====================宠物管理
// 获取宠物信息
export function petListApi(params) {
  return request({
    url: '/owners/pet',
    method: 'get',
    params
  })
}

// 新增
export function addPetApi(data) {
  return request({
    url: 'owners/pet',
    method: 'post',
    data
  })
}

// 修改
export function editPetApi(data) {
  return request({
    url: 'owners/pet/' + data.id,
    method: 'put',
    data
  })
}

// 回显获取详细信息
export function getPetApi(id) {
  return request({
    url: '/owners/pet/' + id,
    method: 'get',
  })
}

// 删除成员
export function delPetApi(id) {
  return request({
    url: '/owners/pet/' + id,
    method: 'delete',

  })
}

// 获取栋数
export function buildingListApi(data) {
  return request({
    url: '/house/building?community_code=' + data,
    method: 'get'
  })
}

// 获取房产
export function useHouseListapi(data) {
  return request({
    url: '/house/index?building_code=' + data,
    method: 'get'
  })
}

// 获取所属成员
export function useMemberapi(data) {
  return request({
    url: '/owners/member?house_code=' + data,
    method: 'get'
  })
}
